package org.wj.arithmetic

import org.apache.spark.rdd.RDD
import org.wj.config.LocalSparkContext

/**
 * 求两个RDD的差集，运算结果不会去重复
 */
object Subtract extends LocalSparkContext{

  private val rdd1: RDD[Int] = sc.parallelize(1 to 10)
  private val rdd2: RDD[Int] = sc.parallelize(5 to 10)

  rdd1.subtract(rdd2).foreach(println(_))

}
